Minikube commands

List of few minikube commands 

Minikube is a popular tool for local Kubernetes cluster setup. It allows developers to experiment and test their applications on a small Kubernetes cluster on their local machine before deploying to a production environment. Minikube provides a simple command-line interface for managing the lifecycle of the Kubernetes cluster. In this blog, we will discuss some of the commonly used Minikube commands, their usage, and output with examples.

  1. minikube start:

The "minikube start" command is used to start a new Minikube cluster. It creates a virtual machine (VM) on the local machine and installs Kubernetes on it. Here's an example of how to start a new Minikube cluster:

$ minikube start

😄  minikube v1.23.2 on Darwin 11.6.2

 Automatically selected the hyperkit driver. Other choices: docker, virtualbox

👍  Starting control plane node minikube in cluster minikube

💾  Downloading Kubernetes v1.23.2 preload ...

    > preloaded-images-k8s-v11-v1...: 542.32 MiB / 542.32 MiB  100.00% 1.14 MiB

🔥  Creating hyperkit VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...

🐳  Preparing Kubernetes v1.23.2 on Docker 20.10.12 ...

🔎  Verifying Kubernetes components...

🌟  Enabled addons: storage-provisioner, default-storageclass

🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

 

The output shows that Minikube has started a new cluster with Kubernetes version 1.23.2, using the hyperkit driver.

  1. minikube stop:

The "minikube stop" command is used to stop the currently running Minikube cluster. It shuts down the VM running Kubernetes. Here's an example of how to stop a running Minikube cluster:

$ minikube stop

 Stopping node "minikube"  ...

🛑  1 nodes stopped.

 The output shows that Minikube has stopped the running cluster.


  1. minikube delete:

The "minikube delete" command is used to delete the currently running Minikube cluster. It removes the VM running Kubernetes and all associated resources. Here's an example of how to delete a running Minikube cluster:


$ minikube delete

🔥  Deleting "minikube" in hyperkit ...

💔  The "minikube" cluster has been deleted.

The output shows that Minikube has deleted the running cluster.

  1. minikube dashboard:

The "minikube dashboard" command is used to open the Kubernetes dashboard for the Minikube cluster in the default web browser. Here's an example of how to open the Kubernetes dashboard:


$ minikube dashboard

🤔  Verifying dashboard health ...

🚀  Launching proxy ...

🤔  Verifying proxy health ...

🎉  Opening http://127.0.0.1:62039/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

The output shows that Minikube has launched a proxy and opened the Kubernetes dashboard in the default web browser. 

5. minikube addons list

This command lists all the available addons that can be enabled in the Minikube cluster. Some of the commonly available addons include dashboard, metrics-server, registry-creds, ingress, and many others. To execute this command, simply type minikube addons list in the terminal.

$ minikube addons list

- addon-manager: enabled

- csi-hostpath-driver: enabled

- dashboard: enabled

- default-storageclass: enabled

- efk: disabled

- freshpod: disabled

- gcp-auth: disabled

- gvisor: disabled

- helm-tiller: disabled

- ingress: enabled

- ingress-dns: disabled

- istio-provisioner: disabled

- istio: disabled

- kubevirt: disabled

- logviewer: disabled

- metallb: disabled

- metrics-server: disabled

- nvidia-driver-installer: disabled

- nvidia-gpu-device-plugin: disabled

- olm: disabled

- pod-security-policy: disabled

- registry: disabled

- registry-aliases: disabled

- registry-creds: disabled

- registry-frontend: disabled

- storage-provisioner: enabled

- storage-provisioner-gluster: disabled

- volumesnapshots: disabled

- windows: disabled

 6. minikube addons enable <addon-name>

This command enables the specified addon in the Minikube cluster. To execute this command, replace <addon-name> with the name of the addon that you want to enable. For example, minikube addons enable dashboard will enable the Kubernetes dashboard addon in the Minikube cluster.

$ minikube addons enable dashboard

🌟  The 'dashboard' addon is enabled

 7. minikube addons disable <addon-name>

This command disables the specified addon in the Minikube cluster. To execute this command, replace <addon-name> with the name of the addon that you want to disable. For example, minikube addons disable dashboard will disable the Kubernetes dashboard addon in the Minikube cluster

$ minikube addons disable dashboard

 The 'dashboard' addon is disabled

 

 8. minikube service <service-name>

This command opens the specified service in the default web browser. To execute this command, replace <service-name> with the name of the service that you want to open in the web browser. For example, minikube service my-service will open the service named my-service in the default web browser.

$ minikube service my-service

|-----------|-----------------------|-------------|---------------------------|

| NAMESPACE |         NAME          | TARGET PORT |            URL            |

|-----------|-----------------------|-------------|---------------------------|

| default   | my-service            |        80   | http://192.168.49.2:30000 |

|-----------|-----------------------|-------------|---------------------------|

🏃  Starting tunnel for service my-service.

|-----------|-----------------------|-------------|------------------------|

| NAMESPACE |         NAME          | TARGET PORT |          URL           |

|-----------|-----------------------|-------------|------------------------|

| default   | my-service            |        80   | http://127.0.0.1:52468 |

|-----------|-----------------------|-------------|------------------------|

🎉  Opening service default/my-service in default browser...

 9. minikube status

This command displays the status of the currently running Minikube cluster.

$ minikube status

host: Running

kubelet: Running

apiserver: Running

 

These are just a few examples of the many commands available in Minikube. You can find more information about Minikube commands by running minikube --help or by checking the Minikube documentation.

 

 

Comments

Popular posts from this blog

Data Science Essentials: Mastering Basic Statistics for Effective Analysis

What is a docker hub?

Explain Docker run with options